package com.ymatou.iapi.trading.sellerquery2.testcase;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.trading.operate.parameter.BargainGroupService;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderResp;
import com.ymatou.iapi.trading.ordersync.service.SyncVerifyService;
import com.ymatou.iapi.trading.sellerquery2.parameter.GetSellerOrderListCountBean;
import com.ymatou.query.trading.api.parameter.resp.GetSellerOrderListCountResp;
import com.ymatou.query.trading.api.parameter.results.GetSellerOrderListCountResult;
import com.ymatou.query.trading.api.parameter.results.GetSellerOrderListCountResult.SellerOrderStatusCountInfo;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.common.enums.OrderDateEnum;
import com.ymttest.common.enums.OrderStatusEnum;
import com.ymttest.database.sqlwapper.DefaultWapper;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.YMTDateUtil;
import com.ymttest.utils.constant.ECode;

/**
 * 获取卖家订单数量 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetSellerOrderListCount {

	private static GetSellerOrderListCountBean request;
	private static com.ymatou.iapi.trading.sellerquery2.service.GetSellerOrderListCountCall call;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取卖家订单数量");
	}

	@Before
	public void caseUp() {

		request = new GetSellerOrderListCountBean();
		call = new com.ymatou.iapi.trading.sellerquery2.service.GetSellerOrderListCountCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verify() {
		GetSellerOrderListCountResp expectResponse = new GetSellerOrderListCountResp();
		constructExpectedResponse(request, expectResponse);
		GetSellerOrderListCountResp actualResponse = call
				.getSellerOrderListCountResp();
		Map<String, Integer> expect = expectResponse.getAllRecordCountDic();
		Map<String, Integer> actual = actualResponse.getAllRecordCountDic();
		if (expect == null) {
			DataUtil.verify(null, actual, "验证AllRecordCountDic == null");
		} else {
			boolean sameSize = expect.size() == actual.size();
			DataUtil.verify(expect.size(), actual.size(),
					"验证AllRecordCountDic.size()");
			if (sameSize) {
				Iterator<String> it = expect.keySet().iterator();
				while (it.hasNext()) {
					String expKey = it.next();
					int expValue = expect.get(expKey);
					boolean exist = actual.containsKey(expKey);
					DataUtil.verify(true, exist,
							"验证AllRecordCountDic中是否存在状态: [" + expKey + "]");
					if (exist) {
						DataUtil.verify(expValue, actual.get(expKey),
								"验证AllRecordCountDic中状态为[" + expKey + "]的数量");
					}
				}
			}
		}
	}

	public void constructExpectedResponse(GetSellerOrderListCountBean request,
			GetSellerOrderListCountResp response) {
		GetSellerOrderListCountResult result = Execute();
		Map<String, Integer> AllRecordCountDic = new HashMap<String, Integer>();
		int total = 0;
		for (GetSellerOrderListCountResult.SellerOrderStatusCountInfo o : result
				.getInfos()) {
			String key = String.valueOf(o.getiTradingStatus());

			if (AllRecordCountDic.containsKey(key)) {
				AllRecordCountDic.put(key,
						AllRecordCountDic.get(key) + o.getNum());
			} else {
				AllRecordCountDic.put(key, o.getNum());
			}

			total += o.getNum();
		}
		AllRecordCountDic.put("0", total);// 总订单量
		if (false == DataUtil.isNullOrEmpty(request.getOrderStatusList())) {
			request.getOrderStatusList().forEach(os -> {
				String t = String.valueOf(os);
				if (!AllRecordCountDic.containsKey(t)) {
					AllRecordCountDic.put(t, 0);
				}
			});
		}
		response.setAllRecordCountDic(AllRecordCountDic);
	}

	@SuppressWarnings("rawtypes")
	public GetSellerOrderListCountResult Execute() {
		GetSellerOrderListCountResult rs = new GetSellerOrderListCountResult();
		List<SellerOrderStatusCountInfo> infos = new ArrayList<GetSellerOrderListCountResult.SellerOrderStatusCountInfo>();

		StringBuilder sql = new StringBuilder();
		sql.append(" select o.iTradingStatus, cast(1 as bit) as bPaidInFull, count(o.iOrderId) as num");
		//砍价团订单，在组团成功前，结果不展示。add by sean 03.09
		sql.append(" from Ymt_Orders o with (nolock,index = idx_Ymt_Orders_iBuyerId_dAddTime)");
		sql.append(" LEFT JOIN dbo.Ymt_OrderBiz b ON b.OrderId = o.iOrderId where ( b.OrderId IS NULL  OR b.BizStatus =3) and o.iBuyerId = "
				+ request.getSellerId());
		if (!DataUtil.isNullOrEmpty(request.getOrderStatusList())) {
			sql.append(" and o.iTradingStatus in "
					+ DataUtil.toInOfSql2(request.getOrderStatusList()));
		}
		int dateType = request.getOrderDateEnum();
		String date = null;
		if (dateType != OrderDateEnum.Unknown.getValue()) {
			if (dateType == OrderDateEnum.CreateDate.getValue()) {
				date = "o.dAddTime";
			} else if (dateType == OrderDateEnum.PayDate.getValue()) {
				date = "o.dPaidTime";
			} else if (dateType == OrderDateEnum.DispatchDate.getValue()) {
				date = "o.dDispathTime";
			} else if (dateType == OrderDateEnum.ApplyPostyPayDate.getValue()) {
				date = "o.dAcceptTime";
			}
		}
		if (date != null) {
			if (request.getBeginTime() != null) {
				sql.append(" and " + date + " >= '" + request.getBeginTime()
						+ "'");
			}
			if (request.getEndTime() != null) {
				sql.append(" and " + date + " <= '" + request.getEndTime()
						+ "'");
			}
		}

		sql.append(" group by o.iTradingStatus");

		List<Map> results = new DefaultWapper().executeSql(sql);

		if (false == DataUtil.isNullOrEmpty(results)) {
			for (Map m : results) {
				GetSellerOrderListCountResult.SellerOrderStatusCountInfo o = new GetSellerOrderListCountResult.SellerOrderStatusCountInfo();
				DataUtil.mapToBean(o, m);
				infos.add(o);
			}
		}
		rs.setInfos(infos);
		return rs;
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_001() {
		Logger.start(true, "获取卖家订单数量成功，根据下单时间查询");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-5,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单时间类型
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			// 卖家ID
			request.setSellerId(SellerId);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_002() {
		Logger.start(true, "获取卖家订单数量成功，根据接单时间查询");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.DispatchDate.getValue());
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_003() {
		Logger.start(true, "sellerid=null,获取卖家订单数量成功");
		try {
			// 参数
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单时间类型
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			// 订单状态
			ArrayList<Integer> OrderStatusList = new ArrayList<Integer>();
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.comment("call send:" + call.getEntityString());
			Logger.comment("call response:" + call.getReturnData());
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	@Ignore
	public void Tc_GetSellerOrderListCount_004() {
		Logger.start(true, "什么都不传,获取卖家订单数量成功");
		try {
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_005() {
		Logger.start(true, "开始时间大于结束时间,获取卖家订单数量成功");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(-100,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单时间类型
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			// 订单状态
			ArrayList<Integer> OrderStatusList = new ArrayList<Integer>();
			request.setOrderStatusList(OrderStatusList);
			// 卖家ID
			request.setSellerId(SellerId);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_006() {
		Logger.start(true, "获取卖家订单数量成功，根据支付时间查询");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.PayDate.getValue());
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_008() {
		Logger.start(true, "获取卖家订单数量成功，根据发货时间查询");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.DispatchDate.getValue());
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_009() {
		Logger.start(true, "验证订单状态为不存在的状态的订单筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-100,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(-1,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单状态
			ArrayList<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(404);
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_010() {
		Logger.start(true, "获取卖家订单数量成功,验证下单状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_011() {
		Logger.start(true, "获取卖家订单数量成功,验证支付状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.AccountPaid.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_012() {
		Logger.start(true, "获取卖家订单数量成功,验证发货状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.Shipped.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_013() {
		Logger.start(true, "获取卖家订单数量成功,验证收货状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.Received.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_014() {
		Logger.start(true, "获取卖家订单数量成功,验证接单状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_015() {
		Logger.start(true, "获取卖家订单数量成功,验证买家取消状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.UserAcceptCancel.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_016() {
		Logger.start(true, "获取卖家订单数量成功,验证卖家取消状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.SellerAcceptCancel.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_017() {
		Logger.start(true, "获取卖家订单数量成功,验证系统取消状态的筛选");
		try {
			int SellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			// 参数
			request.setSellerId(SellerId);
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			List<Integer> OrderStatusList = new ArrayList<Integer>();
			OrderStatusList.add(OrderStatusEnum.SystemCancel.getValue());
			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_018() {
		Logger.start(true, "砍价团订单,组团成功,获取卖家订单数量成功，根据下单时间查询");
		try {
			PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			// 砍价团id
			String bizId = placeOrderResp.getBizId();
			// 开团订单
			Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			// 砍价团参团订单
			PlaceOrderResp placeOrderResp2 = BargainGroupService
					.joinGroup(bizId);
			// 参团
			Integer orderId2 = placeOrderResp2.getOrderList().get(0)
					.getOrderId();

			BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, 3);

			SyncVerifyService.getSyncResult(orderId);

			// 参数
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-5,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单时间类型
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			// 卖家ID
			request.setSellerId(sellerId);
			List<Integer> OrderStatusList = new ArrayList<Integer>();

			OrderStatusList.add(OrderStatusEnum.AccountPaid.getValue());

			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_019() {
		Logger.start(true, "砍价团订单,组团失败,获取卖家订单数量成功，根据下单时间查询");
		try {
			PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			// 砍价团id
			String bizId = placeOrderResp.getBizId();
			// 开团订单
			Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			// 砍价团参团订单
			PlaceOrderResp placeOrderResp2 = BargainGroupService
					.joinGroup(bizId);
			// 参团
			Integer orderId2 = placeOrderResp2.getOrderList().get(0)
					.getOrderId();

			BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, -3);

			SyncVerifyService.getSyncResult(orderId);

			// 参数
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-5,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单时间类型
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			// 卖家ID
			request.setSellerId(sellerId);
			List<Integer> OrderStatusList = new ArrayList<Integer>();

			OrderStatusList.add(OrderStatusEnum.AccountPaid.getValue());

			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerOrderListCount_020() {
		Logger.start(true, "砍价团订单,组团中,获取卖家订单数量成功，根据下单时间查询");
		try {
			PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			// 砍价团id
			String bizId = placeOrderResp.getBizId();
			// 开团订单
			Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			// 砍价团参团订单
			PlaceOrderResp placeOrderResp2 = BargainGroupService
					.joinGroup(bizId);
			// 参团
			Integer orderId2 = placeOrderResp2.getOrderList().get(0)
					.getOrderId();

			BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, 0);

			SyncVerifyService.getSyncResult(orderId);

			// 参数
			String BeginTime = YMTDateUtil.getBeforeOrNextDay(-5,
					YMTDateUtil.YMDTHMS_STRING);
			request.setBeginTime(BeginTime);
			String EndTime = YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMDTHMS_STRING);
			request.setEndTime(EndTime);
			// 订单时间类型
			request.setOrderDateEnum(OrderDateEnum.CreateDate.getValue());
			// 卖家ID
			request.setSellerId(sellerId);
			List<Integer> OrderStatusList = new ArrayList<Integer>();

			OrderStatusList.add(OrderStatusEnum.AccountPaid.getValue());

			request.setOrderStatusList(OrderStatusList);
			// 发送请求
			call.setData(request);
			call.callService();
			Logger.verifyEquals(ECode.SUCCESS, call.getCode(), "验证Code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}